-
-
Notifications
You must be signed in to change notification settings - Fork 238
Be polite to API, respect rate limits #1821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -266,7 +309,7 @@ def _get_gh_response(gh_token, graphql_query): | |||
""" | |||
endpoint = "https://api.github.com/graphql" | |||
headers = {"Authorization": f"bearer {gh_token}"} | |||
return requests.post(endpoint, headers=headers, json=graphql_query).json() | |||
return polite_request(endpoint, headers=headers, json=graphql_query).json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why will this work as a GET request and not a POST request ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @TG1999 for spending your time on my PR and spotting this. You are absolutely right. This should work as a POST request. I should have passed method='POST' .
I'll update _get_gh_response() accordingly to ensure it sends a proper POST request
@unibik gentle ping on this, what's the progress here ? |
Hey @TG1999 , thanks for the reminder! I had paused open-source work for a while after GSoC and continued doing bug bounty programs, but I’d like to pick this up again. I’ll revisit the PR and push the required changes soon.... By the way sorry for late reply, i was busy in my college exams.. |
fix: #506
Implemented polite_request to enforce API rate limits and delays